// 人脸搜索
// Depends on tencentcloud-sdk-nodejs version 4.0.3 or higher
const tencentcloud = require("tencentcloud-sdk-nodejs");

const IaiClient = tencentcloud.iai.v20200303.Client;

const clientConfig = {
  credential: {
    secretId: "AKIDSUKxMWVL0b8bw4zfCYryAE4ez4vWr78t",
    secretKey: "YqtlXDy7ESipiPt9D9wVrCLGxQlunTff",
  },
  region: "ap-beijing",
  profile: {
    httpProfile: {
      endpoint: "iai.tencentcloudapi.com",
    },
  },
};

const client = new IaiClient(clientConfig);
const params = {
  "GroupIds": [
      "star"
  ],
  "Url": "https://img0.baidu.com/it/u=3860515007,3225442203&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=700"
};
client.SearchFaces(params).then(
  (data) => {
    console.log(data);
    // console.log(JSON.stringify(data))
    console.log(JSON.stringify(data, null, 2))
  },
  (err) => {
    console.error("error", err);
  }
);